package com.twu.biblioteca.Model;

import com.twu.biblioteca.Entity.Movie;
import com.twu.biblioteca.Entity.Rating;

import java.util.HashMap;
import java.util.Map;

public class MovieList {
    private static Map<String, Movie> movieList = new HashMap<String, Movie>();

    public MovieList() {
        movieList.put("001", new Movie("001", "The rose", "1995", Rating.one, false, null));
        movieList.put("002", new Movie("002", "The lily", "1982", Rating.three, false, null));
        movieList.put("003", new Movie("003", "The peony", "2001", Rating.six, false, null));
    }

    public Map<String, Movie> getMovieList() {
        return movieList;
    }

    public void updateMovieList(String id, boolean isCheckOut, String borrower) {
        movieList.put(id, new Movie(id, movieList.get(id).getMovieName(), movieList.get(id).getYear(), movieList.get(id).getRating(), isCheckOut, borrower));
    }
}

